//  Created by David "Nirth" on 2008-03-14.
//  Copyright (c) 2008 Ondea. All rights reserved.
package kii.utils
{
	/**
	 * 
	 * @author David.
	 */
	public class StringUtil
	{
		public static function capitalizeWord(word:String):String
		{
			return word.charAt(0).toUpperCase() + word.slice(1, word.length);
		}
		/**
		 * generates random string.
		 */
		public static function random(length:int = 9):String
		{
			var chars:String = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
			var result:String = '';
			for (var i:int = 0; i < length; i++)
				result += chars.substr(Math.floor(Math.random() * chars.length), 1);
			return result;
		}
	}
}